<%@ include file="/common/taglibs.jsp" %>

<c:choose>
    <c:when test="${pageContext.request.locale.language != 'en' && pageContext.request.locale.language != 'zh'}">
        <div id="switchLocale"><a href="<c:url value='${pageContext.request.requestURL}?locale=zh'/>">Chinese</a></div>
    </c:when>
    <c:otherwise>
        <c:if test="${pageContext.request.locale.language != 'en'}">
            <div id="switchLocale"><a href="<c:url value='${pageContext.request.requestURL}?locale=en'/>">English</a></div>
        </c:if>
        <c:if test="${pageContext.request.locale.language != 'zh'}">
            <%--<div id="switchLocale"><a href="<c:url value='/?locale=zh'/>">Chinese</a></div>--%>
            <div id="switchLocale"><a href="<c:url value='${pageContext.request.requestURL}?locale=zh'/>">Chinese</a></div>
        </c:if>
    </c:otherwise>
</c:choose>

<div id="jclogin">
    <c:choose>
        <c:when test="${pageContext.request.remoteUser != null}">

            <a href="/logout.jsp" title="<fmt:message key='user.logout'/>" class="out" style="padding-right: 30px;">
                <fmt:message key="user.logout"/>
            </a>

            <a id="jcwelcome" title="<fmt:message key='welcome.message'/>">
                <c:set var="fname" scope="request"><authz:authentication operation="fullName"/></c:set>
                <fmt:message key="welcome.message.param">
                    <fmt:param value="${fname}"/>
                </fmt:message>
            </a>
            <c:if test="${jron == 'jron'}">
                <s:hidden id="jc_wel" value="%{getText('jc.welcome')}"/>
                <s:hidden id="jc_say" value="%{getText('jc.say')}"/>
                <script type="text/javascript" src="<c:url value='/scripts/jc/jcgrowl.js'/>"></script>
            </c:if>

        </c:when>
        <c:otherwise>
            <a href="<c:url value="/signup.html"/>" title="<fmt:message key='signup.heading'/>" class="re"
               style="padding-right: 30px;">
                <fmt:message key="signup.title"/>
            </a>

            <c:if test="${jron != 'jron'}">
                <a href="/login.jsp" title="<fmt:message key='login.heading'/>" class="in">
                    <fmt:message key="login.title"/>
                </a>
            </c:if>
            
            <c:if test="${jron == 'jron'}">
                <a href="#" title="<fmt:message key='login.heading'/>" class="in"
                   onclick="MOOdalBox.open('<c:url value='/jclogon.html?ajax=true'/>','<fmt:message key='login.heading'/>','450 300');">
                    <fmt:message key="login.title"/>
                </a>
            </c:if>
        </c:otherwise>
    </c:choose>
</div>

<div id="branding">
    <h1><a href="<c:url value='/'/>" title="<fmt:message key='menu.jc'/>">
        <font face="Monotype Corsiva">
            <fmt:message key="webapp.name"/>
        </font>
    </a></h1>

    <p>
        <font face="ArnoPro-Bold">
            <fmt:message key="webapp.tagline"/>
        </font>
    </p>
</div>
<hr/>

<%-- Put constants into request scope --%>
<appfuse:constants scope="request"/>